/*
Project: 		The Impact of Short-Term Employment for Low-Income Youth: Experimental Evidence from the Philippines
Authors: 		Emily A. Beam and Stella Quimbo

***********************************
Path: 			code/02_analysis
File name: 		figure_a02.do 
***********************************

Purpose: 		Generates data for appendix figure 2

Inputs: 		spes_data.dta
Outputs: 		02_figures/figure_a02.png

Log: 			results/03_output/log_figure_a02.log		

Last updated: 	18 November 2021
*/ 


cap log close 
log using "$output/log_figure_a02.log",replace


use "$usedata_analysis/spes_data.dta", clear
keep if endline == 1


recode _spes_tasks1 -222 = 16
recode _spes_tasks2 -222 = 16

forval number = 1/16{
	di `number'
	gen _anytask`number' = _spes_tasks1 == `number' | _spes_tasks2 == `number'
	replace _anytask`number' = . if missing(_spes_tasks1)
}



collapse (mean) _anytask*,by(_NT_edu)
reshape long _anytask, i(_NT_edu) j(anytask)
drop if missing(_NT_edu)
reshape wide _anytask,i(anytask) j(_NT_edu)

list 

cap log close 
